<div class="layui-fluid">
    <div class="layui-card">
      <div class="layui-card-header">投放对比数据记录添加</div>
      <div class="layui-card-body" style="padding: 15px;">
        <form class="layui-form" action="" lay-filter="component-form-group">
          <div class="layui-form-item">
            <label class="layui-form-label">标题</label>
            <div class="layui-input-block">
              <input type="text" name="title" lay-verify="title" autocomplete="off" placeholder="请输入标题" class="layui-input">
            </div>
          </div>
          <div class="layui-form-item">
            <label class="layui-form-label">投放平台</label>
            <div class="layui-input-block">
              <select name="interest" lay-filter="aihao">
                <option value=""></option>
                <option value="1">抖音</option>
                <option value="2">微信</option>
                <option value="3">电子报纸</option>
                <option value="4">微博</option>
                <option value="5">头条</option>
                <option value="5">百度</option>
              </select>
            </div>
          </div>

          <div class="layui-form-item">
            <label class="layui-form-label">内容标题</label>
            <div class="layui-input-block">
              <input type="text" name="username" lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input">
            </div>
          </div>

          <div class="layui-form-item">
            <label class="layui-form-label">访问链接</label>
            <div class="layui-input-block">
              <input type="text" name="username" lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input">
            </div>
          </div>
          <div class="layui-form-item">
            <label class="layui-form-label">链接key</label>
            <div class="layui-input-block">
              <input type="text" name="username" lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input">
            </div>
          </div>
          
          <div class="layui-form-item">
            <div class="layui-inline">
              <label class="layui-form-label">负责人姓名</label>
              <div class="layui-input-inline">
                <input type="text" name="number" lay-verify="required" autocomplete="off" class="layui-input">
              </div>
            </div>
            <div class="layui-inline">
              <label class="layui-form-label">负责人手机号</label>
              <div class="layui-input-inline">
                <input type="tel" name="phone" lay-verify="required|phone" autocomplete="off" class="layui-input">
              </div>
            </div>
            <div class="layui-inline">
              <label class="layui-form-label">负责人邮箱</label>
              <div class="layui-input-inline">
                <input type="text" name="email" lay-verify="email" autocomplete="off" class="layui-input">
              </div>
            </div>
          </div>
          
          <div class="layui-form-item">
            <div class="layui-inline">
              <label class="layui-form-label">对比日期</label>
              <div class="layui-input-inline">
                <input type="text" name="date" id="LAY-component-form-group-date" lay-verify="date" placeholder="yyyy-MM-dd" autocomplete="off" class="layui-input">
              </div>
            </div>
          </div>
          <div class="layui-form-item">
            <div class="layui-inline">
              <label class="layui-form-label">价格范围</label>
              <div class="layui-input-inline" style="width: 100px;">
                <input type="text" name="price_min" placeholder="￥" autocomplete="off" class="layui-input">
              </div>
              <div class="layui-form-mid">-</div>
              <div class="layui-input-inline" style="width: 100px;">
                <input type="text" name="price_max" placeholder="￥" autocomplete="off" class="layui-input">
              </div>
            </div>
          </div>
          
          <div class="layui-form-item">
            <label class="layui-form-label">机构</label>
            <div class="layui-input-block">
              <select name="interest" lay-filter="aihao">
                <option value=""></option>
                <option value="0">机构1</option>
                <option value="1" selected="">机构2</option>
                <option value="2">机构3</option>
                <option value="3">机构4</option>
                <option value="4">机构5</option>
              </select>
            </div>
          </div>
          <div class="layui-form-item">
            <div class="layui-input-block">
              <div class="layui-footer">
                <button class="layui-btn" lay-submit="" lay-filter="component-form-demo1">立即提交</button>
                <button type="reset" class="layui-btn layui-btn-primary">重置</button>
              </div>
            </div>
          </div>
        </form>
      </div>
    </div>
  </div>

  <script>
    layui.use(['admin', 'form', 'laydate'], function(){
      var $ = layui.$
      ,admin = layui.admin
      ,element = layui.element
      ,layer = layui.layer
      ,laydate = layui.laydate
      ,form = layui.form;
      
      form.render(null, 'component-form-group');
    
      laydate.render({
        elem: '#LAY-component-form-group-date'
      });
      
      /* 自定义验证规则 */
      form.verify({
        title: function(value){
          if(value.length < 5){
            return '标题至少得5个字符啊';
          }
        }
        ,pass: [/(.+){6,12}$/, '密码必须6到12位']
        ,content: function(value){
          layedit.sync(editIndex);
        }
      });
      
      /* 监听提交 */
      form.on('submit(component-form-demo1)', function(data){
        layer.alert("提交成功");
        return false;
      });
    });
    </script>